package LC;

/**
 * @ClassName LC7
 * @Description: TODO
 * @Author hl
 * @Date 2020/9/12
 * @Version V1.0
 **/
public class LC7 {
    public int reverse(int x) {
        long j=0;
        while(x!=0){
            j=j*10+x%10;
            x=x/10;
        }
        if(j>Integer.MAX_VALUE||j<Integer.MIN_VALUE){
            return  0;
        }
        return  (int)j;

    }
}
